﻿using System;
using System.Collections.Generic;
using System.Linq;

using Sumen.Model.Model;

namespace Sumen.Business.Presenter.Category
{
    public class ProviderPresenter
    {
     

        public ICollection<provider> GetAll()
        {
            using (sumenEntities obj = new sumenEntities())
            {
                if (ClsPublic.SYSTEM_DISPLAY_ACTIVED == "1")
                    return obj.providers.ToList();
                else
                    return obj.providers.Where(p => p.Prov_Actived == 1).ToList();
            }


        }

        public provider GetById(object pId)
        {
            using (sumenEntities objEntities = new sumenEntities())
            {
                return objEntities.providers.FirstOrDefault(p => p.Prov_ID == pId.ToString());
            }
        }



    }
}
